package com.cysoft.starter.repeat.core.annotation;

import java.lang.annotation.*;
import java.util.concurrent.TimeUnit;

/**
 * @author 玖零
 * @version V0.0.1
 * @project cysoft-spring-boot-starter-repeat
 * @package com.cysoft.starter.repeat.core.annotation
 * @date 2025-03-02 15:07
 * @desc 忽略重复提交注解
 */
@Documented
@Inherited
@Target({ElementType.METHOD, ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
public @interface Repeat {

    /**
     * 默认过期时间10S,针对单独接口请求可以实现不同的防重复提交限制
     */
    long expireTime() default  100000;

    /**
     * 防重复提交时间单元 默认 ms
     * @return
     */
    TimeUnit timeUnit() default TimeUnit.MILLISECONDS;

}
